const utils = {
    objDeepCopy: function (data) {
        var dataCopy = getVarType.isArray(data) == 'array' ? [] : {};
        for (var item in data) {
            dataCopy[item] = (typeof data[item] === 'object' && data[item] != null) ? objDeepCopy(data[item]) : data[item];
        }
        return dataCopy;
    },
    getType: function (obj) {
        if (Object.prototype.toString.call(obj) === '[object Number]') {
            //数字
            return 'Number';
        }
        else if (Object.prototype.toString.call(obj) === '[object String]') {
            //字符串
            return 'String';
        }
        else if (Object.prototype.toString.call(obj) === '[object Array]') {
            //数组
            return 'Array'
        }
        else if (Object.prototype.toString.call(obj) === "[object Function]") {
            //函数
            return 'Function';
        }
        else if (Object.prototype.toString.call(obj) === "[object Boolean]") {
            //Boolean
            return 'Boolean';
        }
        else if (Object.prototype.toString.call(obj) === "[object Null]") {
            //Null
            return 'Null';
        }
        else if (Object.prototype.toString.call(obj) === "[object Object]") {
            //Object
            return 'Object';
        }
        else if (Object.prototype.toString.call(obj) === "[object Undefined]") {
            //Undefined
            return 'Undefined';
        }
    }
}

export default utils